<?php

namespace App\Models;


use App\Service\Base\Model;

class EventPropose extends Model
{

    // 活动推荐
    protected $table = 'event_propose';
    const UPDATED_AT = null;

    // 缓存字段，用于搜索绑定的字段
    protected $cacheFields = ['id', 'uid', 'event_id', 'to_uid'];

    // {"id":"自编号","uid":"用户ID","course_id":"课程id","number":"第几课时数","start_time":"开始时间","end_time":"结束时间","ctime":"注册时间","mtime":"更新时间"}


    // array ( 'id' => '$this->getData("id")', 'uid' => '$this->getData("uid")', 'course_id' => '$this->getData("course_id")', 'number' => '$this->getData("number")', 'start_time' => '$this->getData("start_time")', 'end_time' => '$this->getData("end_time")', 'ctime' => '$this->getData("ctime")', 'mtime' => '$this->getData("mtime")', )


    // $id = $this->getData("id"); $uid = $this->getData("uid"); $course_id = $this->getData("course_id"); $number = $this->getData("number"); $start_time = $this->getData("start_time"); $end_time = $this->getData("end_time"); $ctime = $this->getData("ctime"); $mtime = $this->getData("mtime");

    // 定义验证操作
    public function rules()
    {

        $add = [
        ];

        $edit = [
        ];

        $info = [
        ];


        $rule = [
            'uid'      => 'required',
            'to_uid'   => 'required',
            'event_id' => 'required',
            //'status'     => ['in:-1,0,1,2'],
        ];


        $msg = [
            'id'       => '自编号',
            'uid'      => '用户ID',
            'to_uid'   => '推荐给用户',
            'event_id' => '推荐的活动Id',
            'openid'   => '推荐给用户的openID',
            'ctime'    => '注册时间',
        ];

        return ['rule' => $rule, 'msg' => $msg, 'add' => $add];
    }
}
